package com.itita.player;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.itita.player.util.AppUtil;
import com.umeng.analytics.MobclickAgent;

/**
 * 
 * @author MJiao
 *
 */
public class AbountUsActivity extends Activity {
	private Context context = AbountUsActivity.this;
  
	private Button btnToHome;
    
	private Button btnBack;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about_us);
		
		this.btnToHome = (Button) this.findViewById(R.id.title_btn_refresh);
        this.btnBack = (Button) this.findViewById(R.id.title_bt_left);
        this.btnBack.setText(R.string.back);
        this.btnToHome.setText(R.string.home);
        this.btnToHome.setOnClickListener(mOnClickListener);
        this.btnBack.setOnClickListener(mOnClickListener);
//        MoreFunctionActivity mfa = (MoreFunctionActivity)getParent();
        ((TextView)this.findViewById(R.id.tvTitle)).setText(R.string.about_us);
	}
	
	private View.OnClickListener mOnClickListener = new View.OnClickListener() {
		
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.title_btn_refresh:
				AppUtil.toHomeActiviy(AbountUsActivity.this);
				break;
				
			case R.id.title_bt_left:
				AbountUsActivity.this.finish();
				break;
			}
		}
	};
	//////////////////////////////////////////////
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		AppUtil.onCreateOptionsMenu(menu);
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		AppUtil.onOptionsItemSelected(context, item);
		return super.onOptionsItemSelected(item);
	}
	
	@Override
	protected void onPause() {
		MobclickAgent.onPause(context);
		super.onPause();
	}
	
	@Override
	protected void onResume() {
		MobclickAgent.onResume(context); 
		super.onResume();
	}
	//////////////////////////////////////////////////
}
